import {
  getExtensionRootPath,
  loadJsxFile,
  methodEvaler,
} from '../../core/common'
import { join } from 'path'
import { HostType } from '../../constants/common'

const _evalMethod = methodEvaler(HostType.au)

export function importFiles() {}

/**
 * 初始化, 所有au下api需要在初始化后使用
 *
 * @export
 */
export async function init() {
  const jsxPath = join(getExtensionRootPath(), './jsx/au')
  console.log('init jsx', jsxPath)
  await loadJsxFile(jsxPath)
  return _evalMethod('ping') // 检查是否初始化成功
}
